package cn.com.dcsgo.mapper;

import cn.com.dcsgo.pojo.Employee;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * EmployeeMapper
 *
 * @author Dcsgo
 * @since 2025/2/23 8:14
 */

public interface EmployeeMapper {
    List<Employee> queryAll();

    List<Employee> querySalaryNotLowerThanByName(@Param("name") String name, @Param("salary") Double salary);

    int updateById(Employee employee);

    List<Employee> queryChoose(@Param("name") String name, @Param("salary") Double salary);

    /**
     * 通过id批量查询
     * 不同于简单值类型
     * 这里的集合参数需要用@Param注解起别名，否则只能使用arg0等参数名访问
     *
     * @param ids ids
     * @return List<Employee>
     */
    List<Employee> queryByIds(@Param("ids") List<Integer> ids);

    int insertBatch(@Param("employees") List<Employee> employees);

    int deleteByIds(@Param("ids") List<Integer> ids);

    int updateBatch(@Param("employees") List<Employee> employees);
}
